<!DOCTYPE html>
<html>
<head>
  <title><%= ENV['WEBSITE_TITLE'] %>服务站点日报商务部对接系统</title>
  <meta name="renderer" content="webkit">
  <meta name="apple-mobile-web-app-capable" content="yes">
  <meta name="apple-mobile-web-app-status-bar-style" content="black">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <%= stylesheet_link_tag    'admin', media: 'all', 'data-turbolinks-track': 'reload' %>
  <%= javascript_include_tag 'admin', 'data-turbolinks-track': 'reload' %>
  <%= csrf_meta_tags %>
  <!-- <script src="http://jsconsole.com/remote.js?bbtfr"></script> -->

  <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
  <!--[if lt IE 9]>
    <%= javascript_include_tag  "html5shiv.min" %>
    <%= javascript_include_tag  "respond.min" %>
  <![endif]-->
</head>
<body>
<nav class="navbar navbar-default navbar-static-top">
  <div class="container-fluid">
    <!-- Brand and toggle get grouped for better mobile display -->
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar-collapse">
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <span class="navbar-brand"><%= ENV['WEBSITE_TITLE'] %>服务站点日报商务部对接系统</span>
    </div>

    <!-- Collect the nav links, forms, and other content for toggling -->
    <div class="collapse navbar-collapse" id="navbar-collapse">
      <% if current_user %>
        <ul class="nav navbar-nav">
          <li class="<%= active? controller: 'ssp/reports' %>"><%= link_to "日报管理", ssp_reports_path %></li>
          <% if current_user.admin %>
            <li class="<%= active? controller: 'ssp/users' %>"><%= link_to "站点管理", ssp_users_path %></li>
          <% end %>
        </ul>

        <ul class="nav navbar-nav navbar-right">
          <li class="<%= active? controller: 'ssp/current_users' %>"><%= link_to(current_user.nickname, edit_ssp_current_user_path) %></li>
          <li><%= link_to "退出登录", ssp_user_session_path, method: :delete %></li>
        </ul>
      <% end %>
    </div><!-- /.navbar-collapse -->

  </div><!-- /.container-fluid -->
</nav>

<div class="container-fluid">

<% bootstrap_flash_class = { success: 'alert-success', error: 'alert-danger', alert: 'alert-warning', notice: 'alert-info' } %>
<% flash.each do |type, message| %>
  <div class="alert <%= bootstrap_flash_class[type.to_sym] %>">
    <%= raw message %>
  </div>
<% end %>

<%= yield %>

</div>

<footer class="footer">
  <div class="container-fluid">
    <p class="text-muted">
      版权所有 <%= ENV['WEBSITE_TITLE'] %> 2020
      <span class="divider"></span>
      ICP备案号：<a href="<%= ENV['WEBSITE_ICP_URL'] %>"><%= ENV['WEBSITE_ICP_NO'] %></a>
    </p>
  </div>
</footer>

</body>
</html>
